<script setup lang='ts'>
import { monitorEventLoopDelay } from 'perf_hooks';

const props = defineProps<{
    modelValue:number
}>()


// const emit = defineEmits<{
//     (e:'changeMoney',value:number):void
// }>()

// const sub = () => {
//     emit('changeMoney',props.money - 10 )
// }

const emit = defineEmits<{
    (e:'update:modelValue',value:any):void
}>()

const sub = () => {
    // this.$emit("updata:money",money-10)
    emit('update:modelValue',props.modelValue - 10 )
}

</script>

<template>
<h3>子组件---{{modelValue}}</h3>
<button @click="sub">花钱</button>
</template>

<style scoped>
</style>
